/*
 * 期限下拉model
 * */
#ifndef COMBODATA_H
#define COMBODATA_H
#include <QObject>

#include <QAbstractListModel>
#include <QList>
#include <QPair>
//typedef QVector<QString> QuData;

class ComboData: public QAbstractListModel
{
    Q_OBJECT
public:
    ComboData();
	~ComboData();
    Q_INVOKABLE virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
    Q_INVOKABLE virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
    QHash<int,QByteArray> roleNames() const;
    void AddData(QPair<QString,QString> data);

    //获取显示内容对应的值
    Q_INVOKABLE QString get(int nIndex);

    Q_INVOKABLE void append(QString text,QString role);
	//初始化
private:
    QHash<int,QByteArray> m_roleNames;
    QList<QPair<QString,QString>> m_modeData;   //<name,id>
};

#endif // MAINQUO_H
